package com.example.pet.service;

import com.example.pet.hystrix.UserInfoServiceHystrix;
import com.hj.pet.model.ReturnT;
import com.hj.pet.model.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;


@Component
@FeignClient(name = "pet-user",fallback = UserInfoServiceHystrix.class)
public interface UserInfoService {
    @RequestMapping(value = "/internal/userInfo/save",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> save(@RequestBody UserInfo userInfo);

    @RequestMapping(value = "/internal/userInfo/updateById",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> updateById(@RequestBody UserInfo userInfo);

    @RequestMapping(value = "/internal/userInfo/findUserById",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findUserById(@RequestParam int userId);

    @RequestMapping(value = "/internal/userInfo/findUserByAc",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findUserByAc(@RequestParam String user_account);

    @RequestMapping(value = "/internal/userInfo/findUsersSeller",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findUsersSeller(@RequestParam boolean is_seller);

    @RequestMapping(value = "/internal/userInfo/findUsersVip",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findUsersVip(@RequestParam boolean is_vip);

    @RequestMapping(value = "/internal/userInfo/delUserById",method = RequestMethod.DELETE)
    @ResponseBody
    public ReturnT<?> delUserById(@RequestParam int userId);

    @RequestMapping(value = "/internal/userInfo/findUsers",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findUsers(@RequestBody UserInfo userInfo);

    @RequestMapping(value = "/internal/userInfo/addUserInfo",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> addUserInfo(@RequestBody UserInfo userInfo);
}
